﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TanHungViet.Helper.PaginatedList<TanHungViet.Web.Models.Content>>" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="TanHungViet.Helper"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=ViewData["PageTitle"]%> - TÂN HƯNG VIỆT - HOTLINE: 0835.125.795
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% CultureInfo ci = new CultureInfo(Session["CultureInfo"].ToString());%>
    
    <div class="title-mainright">
	    <h2 class="text1"><%=ViewData["PageTitle"]%><span style="margin-left:20px"> <a target="_blank" href='<%=Url.Action("RSS",new { code = "1"+ViewData["ParentCode"]}) %>'><img src='<%=Url.Content("~/Content/images/feedIcon.png")%>' width="16px"/></a></span></h2>
    </div>
	<div class="content">
		<div class="top-box2"><img src='<%=Url.Content("~/Content/images/top-box2.jpg")%>'/> </div>		
			<div class="center-box2">
			    <%foreach (var item in Model)
                { %>
                    <div style="width:150px;float:left;border: 1px solid #CCC;margin:20px 10px 10px 10px;padding:2px">
                        <a href="#"><img src='<%= item.ContentImage!=null 
                            ? Url.Content(Constant.ImageContentPath + item.ContentImage) : ""%>' width="150px" alt=""/></a>
                    </div>
			        <div style="padding:0px 10px 10px 10px;width:300px;float:left;">
			            <h2 style="color:#d50000;text-transform:uppercase;">
			                <a href="<%=Url.Action("ChiTietTinTuc", new { code = item.ContentCode })%>"><%=item.ContentTitle %></a>
			            </h2>
			            
			            <p style="color:red"><img src="/Content/images/icon-date.png" width="16px">
			                <%= item.PublishDate == null ? DateTime.Now.ToString("dd/MM/yyyy", new CultureInfo("vi-Vn"))
			                    : item.PublishDate.Value.ToString("dd/MM/yyyy", new CultureInfo("vi-Vn"))%>
			            </p>
			            
			            <%=item.BriefDescrip %>
			            
			            <a href="<%=Url.Action("ChiTietTinTuc", new { code = item.ContentCode })%>"><%=ResourceUtil.Instance.GetString("ChiTiet", ci)%> &gt;&gt;</a>
			            
			            <p>
			                <img src='<%=Url.Content("~/Content/images/topic_iconsmall.png")%>' alt=""/> 
			                <%=ResourceUtil.Instance.GetString("ChuyenMuc", ci)%> : 
			                <span style="text-transform:uppercase;"><a href="#"><%=ViewData["PageTitle"]%></a></span>
			            </p>
			        </div>
			        <div class="hinhphanchia">
                        <img src='<%=Url.Content("~/Content/images/hinhphanchia.jpg")%>' alt=""  width="400px"/>
                    </div>
			    <%} %>
			    
			    <div style="text-align:right;color:#2222FF">
                    <b><%= ResourceUtil.Instance.GetString("Trang", ci) %> : </b> 
                    <% 
                        for (int j = Model.PageIndex - 3; j < Model.PageIndex + 6; j++)
                            if (j > 0 && j <= Model.TotalPages)
                            {
                                if (j != Model.PageIndex + 1)
                                    Response.Write(Html.ActionLink(j.ToString(), "TinTuc", new
                                    {
                                        code = ViewData["ParentCode"],
                                        page = j
                                    }));
                                else
                                    Response.Write(j.ToString());

                                if (j < Model.TotalPages)
                                    Response.Write("&nbsp;|&nbsp;");
                            }
                    %>
                </div>
			</div>            	
	</div> 

</asp:Content>

